package com.he.hsdyc.designmodule.observer;

public class Test {

    public static void main(String[] args) {
        Wechat server = new Wechat();

        Observer userZhang = new WechatUser("张三");
        Observer userLi = new WechatUser("李四");
        Observer userWang = new WechatUser("王老板");

        server.addObserver(userZhang);
        server.addObserver(userLi);
        server.addObserver(userWang);
        server.notifyAllServer("今日毒鸡汤：如果你不努力，就不知道什么叫绝望！");

        System.out.println("----------------------------------------------");
        server.delObserver(userZhang);
        server.notifyAllServer("今日毒鸡汤：比你优秀的人都在努力，那你努力还有什么用呢？");

    }
}
